package com.allwees.bs.module.mms.req.register;

import com.allwees.bs.core.modelbase.req.SignedReq;
import com.allwees.bs.core.modelbase.validate.ValidateItem;
import com.allwees.core.common.constant.EPlatform;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;

@Data
@EqualsAndHashCode(callSuper = true)
public class RetailerRegisterResendReq extends SignedReq {

    protected EPlatform platform;

    protected String uuid;

    @Override
    public ValidateItem[] getValidateItems() {
        return ArrayUtils.addAll(
                super.getValidateItems(),
                ValidateItem.of(platform == null, "platform 不能为空"),
                ValidateItem.of(StringUtils.isEmpty(uuid), "uuid 不能为空")
        );
    }

    @Override
    protected Object[] signValues() {
        return new Object[]{platform.name(), uuid, time.getTime()};
    }

    @Override
    protected String signSeparator() {
        return platform.isApp() ? "_AS_" : "_PC_";
    }
}
